<!DOCTYPE html>
<html lang="zh">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>过渡效果</title>
  <style>
    .box {
      width: 100px;
      height: 100px;
      background-color: #00f;
      transition: width 3s;
    }

    .box:hover {
      width: 300px;
    }
  </style>
</head>

<body>
  <div class="box"></div>
</body>

</html>